/* Copyright 2024 NXP
 *
 * NXP Confidential. This software is owned or controlled by NXP and may only
 * be used strictly in accordance with the applicable license terms.  By
 * expressly accepting such terms or by downloading, installing, activating
 * and/or otherwise using the software, you are agreeing that you have read,
 * and that you agree to comply with and are bound by, such license terms.  If
 * you do not agree to be bound by the applicable license terms, then you may
 * not retain, install, activate or otherwise use the software.
 */

#ifndef __UWB_VCOM_PNP_H_
#define __UWB_VCOM_PNP_H_

#if defined(CPU_K32W042S1M2VPJ) || defined(CPU_K32W032S1M2VPJ) || defined(CPU_LPC55S69JBD100_cm33) || \
    defined(CPU_LPC54628J512ET180) || defined(CPU_MIMXRT1176DVMAA) || defined(CPU_RW612HNA1I)

#define USB_TX_RETRY_COUNT 3

/** used in all boards that support USB*/
uint32_t UWB_Usb_UciSendNtfn(uint8_t *pData, uint16_t size);
uint32_t UWB_Usb_SendUCIRsp(uint8_t *pData, uint16_t size);
uint32_t UWB_Usb_SendRsp(uint8_t *pData, uint16_t size);
void Uwb_Usb_Init(void (*rcvCb)(uint8_t *, uint32_t *));

#define Uwb_Vcom_Init        Uwb_Usb_Init
#define UWB_Vcom_UciSendNtfn UWB_Usb_UciSendNtfn
#define UWB_Vcom_SendUCIRsp  UWB_Usb_SendUCIRsp
#define UWB_Vcom_SendRsp     UWB_Usb_SendRsp
#endif //// defined(CPU_K32W042S1M2VPJ) || defined(CPU_K32W032S1M2VPJ) || defined(CPU_LPC55S69JBD100_cm33)

#define MAX_UWBS_SPI_TRANSFER_TIMEOUT (10000)

#if defined(NRF52_SERIES)

/** used in NRF52 Series*/
void Uwb_UART_Init(void (*rcvCb)(uint8_t *, uint32_t *));
uint32_t transmitToUart(uint8_t *pData, size_t size);

#define HEADER_SIZE_USB_PNP 3
#define SET_LED_RED()
#define SET_LED_BLUE()
#define SET_LED_GREEN()
#define CLEAR_LED_RED()
#define CLEAR_LED_BLUE()
#define CLEAR_LED_GREEN()

#define Uwb_Vcom_Init        Uwb_UART_Init
#define Uwb_Vcom_Init        Uwb_UART_Init
#define UWB_Vcom_UciSendNtfn transmitToUart
#define UWB_Vcom_SendUCIRsp  transmitToUart
#define UWB_Vcom_SendRsp     transmitToUart
#endif // defined(NRF52_SERIES)

#if defined(QN9090_SERIES)

/** common for Qn9090 Series*/
uint32_t transmitToUsart(uint8_t *pData, size_t size);
void Uwb_USART_Init(void (*rcvCb)(uint8_t *, uint32_t *));

#define Uwb_Vcom_Init        Uwb_USART_Init
#define UWB_Vcom_UciSendNtfn transmitToUsart
#define UWB_Vcom_SendUCIRsp  transmitToUsart
#define UWB_Vcom_SendRsp     transmitToUsart

#define USART_DEVICE_INTERRUPT_PRIORITY (3U)
#endif // defined(QN9090_SERIES)

#if defined(CPU_MCXW716CMFTA)
uint32_t transmitToLpuart(uint8_t *pData, size_t size);
void Uwb_lpuart_Init(void (*rcvCb)(uint8_t *, uint32_t *));

#define Uwb_Vcom_Init        Uwb_lpuart_Init
#define UWB_Vcom_UciSendNtfn transmitToLpuart
#define UWB_Vcom_SendUCIRsp  transmitToLpuart
#define UWB_Vcom_SendRsp     transmitToLpuart
#endif//defined(CPU_MCXW716CMFTA)

#endif /* __UWB_VCOM_PNP_H_ */
